
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>3.1 Taro 框架介绍 · Taro for Harmony教程</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="坚果派">
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-splitter/splitter.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-tbfed-pagefooter/footer.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-expandable-chapters/expandable-chapters.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-chapter-fold/chapter-fold.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-back-to-top-button/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-code/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-pageview-count/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search-plus/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-mind-maps/mindmaps.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-emphasize/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-anchors/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-ace/ace.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-theme-lou/lou.css">
                
            
        

    

    
        
        <link rel="stylesheet" href="../styles/website.css">
        
    

        
    
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="2.安装Taro.html" />
    
    
    <link rel="prev" href="../为什么要写博客.html" />
    

    <style>
    @media only screen and (max-width: 640px) {
        .book-header .hidden-mobile {
            display: none;
        }
    }
    </style>
    <script>
        window["gitbook-plugin-github-buttons"] = {"repo":"ITmxs/gitbook","types":["star","watch","fork"],"size":"small"};
    </script>

    </head>
    <body>
         
<div class="donate-modal modal">
  <div class="modal-header">
    <div>
      <span>
        <img
          id="modal-avatar"
          class="modal-avatar"
          src="http://xkapp-uat.oss-cn-hangzhou.aliyuncs.com/2e7a3f70-80ab-4b50-93ec-a04dfeef949b/avatar-100.png"
        />
      </span>
      <span id="nickname"> breeze </span>
      <p class="modal-close close" onclick="closeDonateModal()">×</p>
    </div>
    <div class="message">
      <div class="tip">
        <i></i>
        <span>随意打赏，但不要超过一顿早餐钱 💕</span>
      </div>
    </div>
  </div>
  <div class="modal-content">
    <div class="modal-pay-way">
      <div id="wxpay" onclick="showDonateImg(0)">
        <input
          type="radio"
          name="pay-way"
          value="wxpay"
          class="zs-type"
          checked="checked"
        />
        <span>
          <img
            id="wxpay-logo"
            src=""
          />
        </span>
      </div>
      <div id="alipay" onclick="showDonateImg(1)">
        <input type="radio" name="pay-way" value="alipay" class="zs-type" />
        <span>
          <img
            id="alipay-logo"
            src=""
          />
        </span>
      </div>
    </div>
    <div class="modal-pay-qrcode">
      <img id="wxpay-code" src="https://luckly007.oss-cn-beijing.aliyuncs.com/img/image-20210922202901895.png" />
      <img
        id="alipay-code"
        src="https://luckly007.oss-cn-beijing.aliyuncs.com/img/image-20210922202843746.png"
        hidden
      />
    </div>
  </div>
</div>
<div class="mask"></div>


<div class="book">
  <div class="header-inner">
    <!-- LOGO -->
    <div class="logo"></div>
    <span class="title"></span>

    <!-- Search -->
    
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>


    <!-- Nav -->
    <ul class="header-nav">
      <li>
        <a href="https://www.gitbook.com/" target="_blank">坚果派官网</a>
      </li><li>
        <a href="https://www.npmjs.com/package/package" target="_blank">ArkUI实战</a>
      </li><li>
        <a href="https://space.bilibili.com/480883651" target="_blank">元服务开发实践</a>
      </li><li>
        <a href="https://blog.51cto.com/jianguo" target="_blank">OpenHarmony应用开发</a>
      </li>
    </ul>
  </div>

  <div class="book-summary">
    <div class="book-summary-title">文档目录</div>
     
    <nav role="navigation">


<ul class="summary">
    
    

    

    
        
        <li class="header">第一篇：基础篇</li>
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    前言
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../为什么要写博客.html">
            
                <a href="../为什么要写博客.html">
            
                    
                    为什么选择 Taro For Harmony？
            
                </a>
            

            
        </li>
    

    
        
        <li class="header">第二篇：Taro 入门</li>
        
        
    
        <li class="chapter active" data-level="2.1" data-path="1.Taro介绍.html">
            
                <a href="1.Taro介绍.html">
            
                    
                    3.1 Taro 框架介绍
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2" data-path="2.安装Taro.html">
            
                <a href="2.安装Taro.html">
            
                    
                    3.2 安装与配置 Taro
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.3" data-path="3.Taro运行多平台.html">
            
                <a href="3.Taro运行多平台.html">
            
                    
                    3.3 Taro 多平台运行
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.4" data-path="4.Taro配置.html">
            
                <a href="4.Taro配置.html">
            
                    
                    3.4 Taro 项目配置详解
            
                </a>
            

            
        </li>
    

    
        
        <li class="header">第三篇：鸿蒙平台开发</li>
        
        
    
        <li class="chapter " data-level="3.1" data-path="5.鸿蒙版Taro搭建开发环境.html">
            
                <a href="5.鸿蒙版Taro搭建开发环境.html">
            
                    
                    4.1 鸿蒙版 Taro 开发环境搭建
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.2" data-path="6.鸿蒙版taro编译配置.html">
            
                <a href="6.鸿蒙版taro编译配置.html">
            
                    
                    4.2 鸿蒙版 Taro 编译配置
            
                </a>
            

            
        </li>
    

    
        
        <li class="header">第四篇：进阶开发</li>
        
        
    
        <li class="chapter " data-level="4.1" data-path="../chapter5/1.组件开发与适配.html">
            
                <a href="../chapter5/1.组件开发与适配.html">
            
                    
                    5.1 组件开发与适配
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.2" data-path="../chapter5/2.状态管理.md">
            
                <span>
            
                    
                    5.2 状态管理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.3" data-path="../chapter5/3.路由与导航.md">
            
                <span>
            
                    
                    5.3 路由与导航
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.4" data-path="../chapter5/4.网络请求与数据处理.md">
            
                <span>
            
                    
                    5.4 网络请求与数据处理
            
                </a>
            

            
        </li>
    

    
        
        <li class="header">第五篇：实战项目</li>
        
        
    
        <li class="chapter " data-level="5.1" data-path="../chapter6/1.项目架构设计.md">
            
                <span>
            
                    
                    6.1 项目架构设计
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.2" data-path="../chapter6/2.实战案例.md">
            
                <span>
            
                    
                    6.2 实战案例：待办事项应用
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.3" data-path="../chapter6/3.性能优化与调试.md">
            
                <span>
            
                    
                    6.3 性能优化与调试
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.4" data-path="../chapter6/4.发布与部署.md">
            
                <span>
            
                    
                    6.4 发布与部署
            
                </a>
            

            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>

</nav>
     
  </div>

  <!-- Content nav -->
  <div class="book-anchor">
    <div class="book-anchor-title"></div>

    <div class="book-anchor-body"></div>
  </div>

  <div class="book-body">
    
    <div class="body-inner">
       

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >3.1 Taro 框架介绍</a>
    </h1>
</div>



      <div class="page-wrapper" tabindex="-1" role="main">
        <div class="page-inner">
          
<div class="search-plus" id="book-search-results">
    <div class="search-noresults">
    
          <section class="normal markdown-section">
             
                <div id="vip-container">
                    <h1 id="&#x9E3F;&#x8499;&#x7248;taro&#x6E10;&#x8FDB;&#x5F0F;&#x5165;&#x95E8;&#x6559;&#x7A0B;"><a name="&#x9E3F;&#x8499;&#x7248;taro&#x6E10;&#x8FDB;&#x5F0F;&#x5165;&#x95E8;&#x6559;&#x7A0B;" class="plugin-anchor" href="#&#x9E3F;&#x8499;&#x7248;taro&#x6E10;&#x8FDB;&#x5F0F;&#x5165;&#x95E8;&#x6559;&#x7A0B;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x9E3F;&#x8499;&#x7248;Taro&#x6E10;&#x8FDB;&#x5F0F;&#x5165;&#x95E8;&#x6559;&#x7A0B;</h1>
<h2 id="taro-&#x4ECB;&#x7ECD;"><a name="taro-&#x4ECB;&#x7ECD;" class="plugin-anchor" href="#taro-&#x4ECB;&#x7ECD;"><i class="fa fa-link" aria-hidden="true"></i></a>Taro &#x4ECB;&#x7ECD;</h2>
<p>Taro &#x662F;&#x7531;&#x4EAC;&#x4E1C;&#x53D1;&#x8D77;&#x5E76;&#x7EF4;&#x62A4;&#x7684;&#x5F00;&#x653E;&#x5F0F;&#x8DE8;&#x7AEF;&#x8DE8;&#x6846;&#x67B6;&#x89E3;&#x51B3;&#x65B9;&#x6848;&#xFF0C;&#x652F;&#x6301;&#x4EE5; Web &#x7684;&#x5F00;&#x53D1;&#x8303;&#x5F0F;&#x6765;&#x5B9E;&#x73B0;&#x5C0F;&#x7A0B;&#x5E8F;&#x3001;H5&#x3001;&#x539F;&#x751F; APP &#x7684;&#x8DE8;&#x7AEF;&#x7EDF;&#x4E00;&#x5F00;&#x53D1;&#xFF0C;&#x4ECE; 18 &#x5E74;&#x5F00;&#x6E90;&#x81F3;&#x4ECA;&#xFF0C;&#x5728; GitHub &#x5DF2;&#x7D2F;&#x8BA1;&#x83B7;&#x5F97; 36,000+ Stars&#x3002;</p>
<h2 id="&#x73AF;&#x5883;&#x51C6;&#x5907;"><a name="&#x73AF;&#x5883;&#x51C6;&#x5907;" class="plugin-anchor" href="#&#x73AF;&#x5883;&#x51C6;&#x5907;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x73AF;&#x5883;&#x51C6;&#x5907;</h2>
<p>&#x76EE;&#x524D; Taro &#x4EC5;&#x63D0;&#x4F9B;&#x4E00;&#x79CD;&#x5F00;&#x53D1;&#x65B9;&#x5F0F;&#xFF1A;&#x5B89;&#x88C5; Taro &#x547D;&#x4EE4;&#x884C;&#x5DE5;&#x5177;&#xFF08;Taro CLI&#xFF09;&#x8FDB;&#x884C;&#x5F00;&#x53D1;&#x3002;</p>
<p>Taro CLI &#x4F9D;&#x8D56;&#x4E8E; Node.js &#x73AF;&#x5883;&#xFF0C;&#x6240;&#x4EE5;&#x5728;&#x4F60;&#x7684;&#x673A;&#x5668;&#x4E0A;&#x5FC5;&#x987B;&#x5B89;&#x88C5; Node.js &#x73AF;&#x5883;&#x3002;&#x5B89;&#x88C5; Node.js &#x73AF;&#x5883;&#x6709;&#x5F88;&#x591A;&#x79CD;&#x65B9;&#x6CD5;&#xFF0C;&#x5982;&#x679C;&#x4F60;&#x5B8C;&#x5168;&#x4E0D;&#x4E86;&#x89E3; Node.js &#x53EF;&#x4EE5;&#x8BBF;&#x95EE; <a href="https://nodejs.org/en/" target="_blank">Node.js &#x5B98;&#x7F51;</a> &#x4E0B;&#x8F7D;&#x4E00;&#x4E2A;&#x53EF;&#x6267;&#x884C;&#x7A0B;&#x5E8F;&#x8FDB;&#x884C;&#x5B89;&#x88C5;&#x3002;&#x8BF7;&#x786E;&#x4FDD;&#x5DF2;&#x5177;&#x5907;&#x8F83;&#x65B0;&#x7684; node &#x73AF;&#x5883;&#xFF08;&gt;=16.20.0&#xFF09;&#x3002;</p>
<p>&#x5F53;&#x4F60;&#x7684;&#x673A;&#x5668;&#x5DF2;&#x7ECF;&#x5B58;&#x5728;&#x4E86; Node.js &#x73AF;&#x5883;&#xFF0C;&#x53EF;&#x4EE5;&#x901A;&#x8FC7;&#x5728;&#x7EC8;&#x7AEF;&#x8F93;&#x5165;&#x547D;&#x4EE4; <code>npm i -g @tarojs/cli</code> &#x5B89;&#x88C5; Taro CLI&#x3002;&#x5B89;&#x88C5;&#x5B8C;&#x6BD5;&#x4E4B;&#x540E;&#xFF0C;&#x5728;&#x7EC8;&#x7AEF;&#x8F93;&#x5165;&#x547D;&#x4EE4; <code>taro</code>&#xFF0C;&#x5982;&#x679C;&#x51FA;&#x73B0;&#x7C7B;&#x4F3C;&#x5185;&#x5BB9;&#x5C31;&#x8BF4;&#x660E;&#x5B89;&#x88C5;&#x6210;&#x529F;&#x4E86;&#xFF1A;</p>
<pre><code>jianguo@nutpi fvmdemo % taro --version 
&#x1F47D; Taro v4.1.1

4.1.1
</code></pre><h3 id="&#x7F16;&#x8F91;&#x5668;"><a name="&#x7F16;&#x8F91;&#x5668;" class="plugin-anchor" href="#&#x7F16;&#x8F91;&#x5668;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x7F16;&#x8F91;&#x5668;</h3>
<p>&#x63A8;&#x8350;&#x4F7F;&#x7528; <a href="https://code.visualstudio.com/" target="_blank">VSCode</a> </p>
<p>&#x5F53;&#x4F60;&#x4F7F;&#x7528; VSCode &#x65F6;&#xFF0C;&#x63A8;&#x8350;&#x5B89;&#x88C5; <a href="https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint" target="_blank">ESLint &#x63D2;&#x4EF6;</a>&#xFF0C;&#x5982;&#x679C;&#x4F60;&#x4F7F;&#x7528; TypeScript&#xFF0C;&#x522B;&#x5FD8;&#x4E86;&#x914D;&#x7F6E; <code>eslint.probe</code> &#x53C2;&#x6570;&#x3002;&#x5982;&#x679C;&#x4F7F;&#x7528; Vue&#xFF0C;&#x63A8;&#x8350;&#x5B89;&#x88C5; <a href="https://marketplace.visualstudio.com/items?itemName=octref.vetur" target="_blank">Vetur</a> &#x63D2;&#x4EF6;&#x3002;&#x5B89;&#x88C5;&#x4E86;&#x4E0A;&#x8FF0;&#x63D2;&#x4EF6;&#x4E4B;&#x540E;&#x4F7F;&#x7528; Taro &#x90FD;&#x5B9E;&#x73B0;&#x81EA;&#x52A8;&#x8865;&#x5168;&#x548C;&#x4EE3;&#x7801;&#x5B9E;&#x65F6;&#x68C0;&#x67E5;&#xFF08;linting&#xFF09;&#x7684;&#x529F;&#x80FD;&#x3002;</p>
<h3 id="&#x7EC8;&#x7AEF;"><a name="&#x7EC8;&#x7AEF;" class="plugin-anchor" href="#&#x7EC8;&#x7AEF;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x7EC8;&#x7AEF;</h3>
<h4 id="macoslinux"><a name="macoslinux" class="plugin-anchor" href="#macoslinux"><i class="fa fa-link" aria-hidden="true"></i></a>macOS/Linux</h4>
<p>&#x5728; *nix &#x7CFB;&#x7EDF;&#x4E2D;&#x7EC8;&#x7AEF;&#x6A21;&#x62DF;&#x5668;&#x4F7F;&#x7528;&#x4EC0;&#x4E48;&#x5DE5;&#x5177;&#xFF08;Terminal/iTerm2/Konsole/Hyper/etc..&#xFF09;&#x5E76;&#x4E0D;&#x91CD;&#x8981;&#xFF0C;&#x4F46;&#x8FD0;&#x884C; Taro CLI &#x7684; shell &#x6211;&#x4EEC;&#x63A8;&#x8350;&#x4F7F;&#x7528; <code>bash</code> &#x6216; <code>zsh</code>&#x3002;</p>
<h4 id="windows"><a name="windows" class="plugin-anchor" href="#windows"><i class="fa fa-link" aria-hidden="true"></i></a>Windows</h4>
<p>&#x5728; Windows &#x4E2D;&#x6211;&#x4EEC;&#x63A8;&#x8350;&#x4F7F;&#x7528;&#x5185;&#x7F6E;&#x7684; <code>cmd</code> &#x6216; <code>PowerShell</code>&#x3002;&#x5982;&#x679C;&#x6709;&#x6761;&#x4EF6;&#x63A8;&#x8350;&#x5B89;&#x88C5; <a href="https://docs.microsoft.com/zh-cn/windows/wsl/install-win10" target="_blank">WSL</a> &#x5E76;&#x4F7F;&#x7528; Linux &#x5206;&#x53D1;&#x7248;&#x7684;&#x7EC8;&#x7AEF;&#x8FD0;&#x884C; Taro CLI&#x3002;&#x7531;&#x4E8E; Taro &#x7684;&#x5F00;&#x53D1;&#x56E2;&#x961F;&#x548C; CI &#x90FD;&#x53EA;&#x8FD0;&#x884C;&#x6216;&#x6D4B;&#x8BD5; *nix &#x7CFB;&#x7EDF;&#xFF0C;&#x90E8;&#x5206; Windows &#x6781;&#x7AEF;&#x60C5;&#x51B5;&#x6216;&#x8BB8;&#x6CA1;&#x80FD;&#x8003;&#x8651;&#x5230;&#xFF0C;&#x5BFC;&#x81F4;&#x51FA;&#x73B0; Bug&#x3002;</p>
<h2 id="&#x57FA;&#x7840;&#x6559;&#x7A0B;"><a name="&#x57FA;&#x7840;&#x6559;&#x7A0B;" class="plugin-anchor" href="#&#x57FA;&#x7840;&#x6559;&#x7A0B;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x57FA;&#x7840;&#x6559;&#x7A0B;</h2>
<p>&#x5B89;&#x88C5;&#x597D; Taro CLI &#x4E4B;&#x540E;&#x53EF;&#x4EE5;&#x901A;&#x8FC7; <code>taro init</code> &#x547D;&#x4EE4;&#x521B;&#x5EFA;&#x4E00;&#x4E2A;&#x5168;&#x65B0;&#x7684;&#x9879;&#x76EE;&#xFF0C;&#x4F60;&#x53EF;&#x4EE5;&#x6839;&#x636E;&#x4F60;&#x7684;&#x9879;&#x76EE;&#x9700;&#x6C42;&#x586B;&#x5199;&#x5404;&#x4E2A;&#x9009;&#x9879;&#xFF0C;&#x4E00;&#x4E2A;&#x6700;&#x5C0F;&#x7248;&#x672C;&#x7684; Taro &#x9879;&#x76EE;&#x4F1A;&#x5305;&#x62EC;&#x4EE5;&#x4E0B;&#x6587;&#x4EF6;&#xFF1A;</p>
<pre><code>&#x251C;&#x2500;&#x2500; babel.config.js             # Babel &#x914D;&#x7F6E;
&#x251C;&#x2500;&#x2500; .eslintrc.js                # ESLint &#x914D;&#x7F6E;
&#x251C;&#x2500;&#x2500; config                      # &#x7F16;&#x8BD1;&#x914D;&#x7F6E;&#x76EE;&#x5F55;
&#x2502;   &#x251C;&#x2500;&#x2500; dev.js                  # &#x5F00;&#x53D1;&#x6A21;&#x5F0F;&#x914D;&#x7F6E;
&#x2502;   &#x251C;&#x2500;&#x2500; index.js                # &#x9ED8;&#x8BA4;&#x914D;&#x7F6E;
&#x2502;   &#x2514;&#x2500;&#x2500; prod.js                 # &#x751F;&#x4EA7;&#x6A21;&#x5F0F;&#x914D;&#x7F6E;
&#x251C;&#x2500;&#x2500; package.json                # Node.js manifest
&#x251C;&#x2500;&#x2500; dist                        # &#x6253;&#x5305;&#x76EE;&#x5F55;
&#x251C;&#x2500;&#x2500; project.config.json         # &#x5C0F;&#x7A0B;&#x5E8F;&#x9879;&#x76EE;&#x914D;&#x7F6E;
&#x251C;&#x2500;&#x2500; src # &#x6E90;&#x7801;&#x76EE;&#x5F55;
&#x2502;   &#x251C;&#x2500;&#x2500; app.config.js           # &#x5168;&#x5C40;&#x914D;&#x7F6E;
&#x2502;   &#x251C;&#x2500;&#x2500; app.css                 # &#x5168;&#x5C40; CSS
&#x2502;   &#x251C;&#x2500;&#x2500; app.js                  # &#x5165;&#x53E3;&#x7EC4;&#x4EF6;
&#x2502;   &#x251C;&#x2500;&#x2500; index.html              # H5 &#x5165;&#x53E3; HTML
&#x2502;   &#x2514;&#x2500;&#x2500; pages                   # &#x9875;&#x9762;&#x7EC4;&#x4EF6;
&#x2502;       &#x2514;&#x2500;&#x2500; index
&#x2502;           &#x251C;&#x2500;&#x2500; index.config.js # &#x9875;&#x9762;&#x914D;&#x7F6E;
&#x2502;           &#x251C;&#x2500;&#x2500; index.css       # &#x9875;&#x9762; CSS
&#x2502;           &#x2514;&#x2500;&#x2500; index.jsx       # &#x9875;&#x9762;&#x7EC4;&#x4EF6;&#xFF0C;&#x5982;&#x679C;&#x662F; Vue &#x9879;&#x76EE;&#xFF0C;&#x6B64;&#x6587;&#x4EF6;&#x4E3A; index.vue
</code></pre><p>&#x6211;&#x4EEC;&#x4EE5;&#x540E;&#x5C06;&#x4F1A;&#x8BB2;&#x89E3;&#x6BCF;&#x4E00;&#x4E2A;&#x6587;&#x4EF6;&#x7684;&#x4F5C;&#x7528;&#xFF0C;&#x4F46;&#x73B0;&#x5728;&#xFF0C;&#x6211;&#x4EEC;&#x5148;&#x628A;&#x6CE8;&#x610F;&#x529B;&#x805A;&#x7126;&#x5728; <code>src</code> &#x6587;&#x4EF6;&#x5939;&#xFF0C;&#x4E5F;&#x5C31;&#x662F;&#x6E90;&#x7801;&#x76EE;&#x5F55;&#xFF1A;</p>
<h3 id="&#x5165;&#x53E3;&#x7EC4;&#x4EF6;"><a name="&#x5165;&#x53E3;&#x7EC4;&#x4EF6;" class="plugin-anchor" href="#&#x5165;&#x53E3;&#x7EC4;&#x4EF6;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x5165;&#x53E3;&#x7EC4;&#x4EF6;</h3>
<p>&#x6BCF;&#x4E00;&#x4E2A; Taro &#x9879;&#x76EE;&#x90FD;&#x6709;&#x4E00;&#x4E2A;&#x5165;&#x53E3;&#x7EC4;&#x4EF6;&#x548C;&#x4E00;&#x4E2A;&#x5165;&#x53E3;&#x914D;&#x7F6E;&#xFF0C;&#x6211;&#x4EEC;&#x53EF;&#x4EE5;&#x5728;&#x5165;&#x53E3;&#x7EC4;&#x4EF6;&#x4E2D;&#x8BBE;&#x7F6E;&#x5168;&#x5C40;&#x72B6;&#x6001;/&#x5168;&#x5C40;&#x751F;&#x547D;&#x5468;&#x671F;&#xFF0C;&#x4E00;&#x4E2A;&#x6700;&#x5C0F;&#x5316;&#x7684;&#x5165;&#x53E3;&#x7EC4;&#x4EF6;&#x4F1A;&#x662F;&#x8FD9;&#x6837;&#xFF1A;</p>
<p>src/app.js</p>
<pre><code class="lang-react">import React, { Component } from &apos;react&apos;
import &apos;./app.css&apos;

class App extends Component {
  render() {
    // this.props.children &#x662F;&#x5C06;&#x8981;&#x4F1A;&#x6E32;&#x67D3;&#x7684;&#x9875;&#x9762;
    return this.props.children
  }
}

// &#x6BCF;&#x4E00;&#x4E2A;&#x5165;&#x53E3;&#x7EC4;&#x4EF6;&#x90FD;&#x5FC5;&#x987B;&#x5BFC;&#x51FA;&#x4E00;&#x4E2A; React &#x7EC4;&#x4EF6;
export default App
</code></pre>
<p>&#x6BCF;&#x4E00;&#x4E2A;&#x5165;&#x53E3;&#x7EC4;&#x4EF6;&#xFF08;&#x4F8B;&#x5982; <code>app.js</code>&#xFF09;&#x603B;&#x662F;&#x4F34;&#x968F;&#x4E00;&#x4E2A;&#x5168;&#x5C40;&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#xFF08;&#x4F8B;&#x5982; <code>app.config.js</code>&#xFF09;&#xFF0C;&#x6211;&#x4EEC;&#x53EF;&#x4EE5;&#x5728;&#x5168;&#x5C40;&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x4E2D;&#x8BBE;&#x7F6E;&#x9875;&#x9762;&#x7EC4;&#x4EF6;&#x7684;&#x8DEF;&#x5F84;&#x3001;&#x5168;&#x5C40;&#x7A97;&#x53E3;&#x3001;&#x8DEF;&#x7531;&#x7B49;&#x4FE1;&#x606F;&#xFF0C;&#x4E00;&#x4E2A;&#x6700;&#x7B80;&#x5355;&#x7684;&#x5168;&#x5C40;&#x914D;&#x7F6E;&#x5982;&#x4E0B;&#xFF1A;</p>
<p>src/app.config.js</p>
<pre><code>export default {
  pages: [&apos;pages/index/index&apos;],
}
</code></pre><p>&#x6CE8;&#x610F;&#x6211;&#x4EEC;&#x5FC5;&#x987B;&#x4FDD;&#x8BC1;&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x662F;&#x5728; Node.js &#x73AF;&#x5883;&#x4E2D;&#x662F;&#x53EF;&#x4EE5;&#x6267;&#x884C;&#x7684;&#xFF0C;&#x4E0D;&#x80FD;&#x4F7F;&#x7528;&#x4E00;&#x4E9B;&#x5728; H5 &#x73AF;&#x5883;&#x6216;&#x5C0F;&#x7A0B;&#x5E8F;&#x73AF;&#x5883;&#x624D;&#x80FD;&#x8FD0;&#x884C;&#x7684;&#x5305;&#x6216;&#x8005;&#x4EE3;&#x7801;&#xFF0C;&#x5426;&#x5219;&#x7F16;&#x8BD1;&#x5C06;&#x4F1A;&#x5931;&#x8D25;</p>
<h3 id="&#x9875;&#x9762;&#x7EC4;&#x4EF6;"><a name="&#x9875;&#x9762;&#x7EC4;&#x4EF6;" class="plugin-anchor" href="#&#x9875;&#x9762;&#x7EC4;&#x4EF6;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x9875;&#x9762;&#x7EC4;&#x4EF6;</h3>
<p>&#x9875;&#x9762;&#x7EC4;&#x4EF6;&#x662F;&#x6BCF;&#x4E00;&#x9879;&#x8DEF;&#x7531;&#x5C06;&#x4F1A;&#x6E32;&#x67D3;&#x7684;&#x9875;&#x9762;&#xFF0C;Taro &#x7684;&#x9875;&#x9762;&#x9ED8;&#x8BA4;&#x653E;&#x5728; <code>src/pages</code> &#x4E2D;&#xFF0C;&#x6BCF;&#x4E00;&#x4E2A; Taro &#x9879;&#x76EE;&#x81F3;&#x5C11;&#x6709;&#x4E00;&#x4E2A;&#x9875;&#x9762;&#x7EC4;&#x4EF6;&#x3002;&#x5728;&#x6211;&#x4EEC;&#x751F;&#x6210;&#x7684;&#x9879;&#x76EE;&#x4E2D;&#x6709;&#x4E00;&#x4E2A;&#x9875;&#x9762;&#x7EC4;&#x4EF6;&#xFF1A;<code>src/pages/index/index</code>&#xFF0C;&#x7EC6;&#x5FC3;&#x7684;&#x670B;&#x53CB;&#x53EF;&#x4EE5;&#x53D1;&#x73B0;&#xFF0C;&#x8FD9;&#x4E2A;&#x8DEF;&#x5F84;&#x6070;&#x5DE7;&#x5BF9;&#x5E94;&#x7684;&#x5C31;&#x662F;&#x6211;&#x4EEC;<a href="https://docs.taro.zone/docs/app-config" target="_blank">&#x5168;&#x5C40;&#x914D;&#x7F6E;</a>&#x7684; <code>pages</code> &#x5B57;&#x6BB5;&#x5F53;&#x4E2D;&#x7684;&#x503C;&#x3002;&#x4E00;&#x4E2A;&#x7B80;&#x5355;&#x7684;&#x9875;&#x9762;&#x7EC4;&#x4EF6;&#x5982;&#x4E0B;</p>
<p>src/pages/index/index.jsx</p>
<pre><code class="lang-react">import { View } from &apos;@tarojs/components&apos;
class Index extends Component {
  state = {
    msg: &apos;Hello World!&apos;,
  }

  onReady() {
    console.log(&apos;onReady&apos;)
  }

  render() {
    return &lt;View&gt;{this.state.msg}&lt;/View&gt;
  }
}

export default Index
</code></pre>
<ol>
<li><code>onReady</code> &#x751F;&#x547D;&#x5468;&#x671F;&#x51FD;&#x6570;&#x3002;&#x8FD9;&#x662F;&#x6765;&#x6E90;&#x4E8E;&#x5FAE;&#x4FE1;&#x5C0F;&#x7A0B;&#x5E8F;&#x89C4;&#x8303;&#x7684;&#x751F;&#x547D;&#x5468;&#x671F;&#xFF0C;&#x8868;&#x793A;&#x7EC4;&#x4EF6;&#x9996;&#x6B21;&#x6E32;&#x67D3;&#x5B8C;&#x6BD5;&#xFF0C;&#x51C6;&#x5907;&#x597D;&#x4E0E;&#x89C6;&#x56FE;&#x4EA4;&#x4E92;&#x3002;Taro &#x5728;&#x8FD0;&#x884C;&#x65F6;&#x5C06;&#x5927;&#x90E8;&#x5206;&#x5C0F;&#x7A0B;&#x5E8F;&#x89C4;&#x8303;&#x9875;&#x9762;&#x751F;&#x547D;&#x5468;&#x671F;&#x6CE8;&#x5165;&#x5230;&#x4E86;&#x9875;&#x9762;&#x7EC4;&#x4EF6;&#x4E2D;&#xFF0C;&#x540C;&#x65F6; React &#x6216; Vue &#x81EA;&#x5E26;&#x7684;&#x751F;&#x547D;&#x5468;&#x671F;&#x4E5F;&#x662F;&#x5B8C;&#x5168;&#x53EF;&#x4EE5;&#x6B63;&#x5E38;&#x4F7F;&#x7528;&#x7684;&#x3002;</li>
<li><code>View</code> &#x7EC4;&#x4EF6;&#x3002;&#x8FD9;&#x662F;&#x6765;&#x6E90;&#x4E8E; <code>@tarojs/components</code> &#x7684;&#x8DE8;&#x5E73;&#x53F0;&#x7EC4;&#x4EF6;&#x3002;&#x76F8;&#x5BF9;&#x4E8E;&#x6211;&#x4EEC;&#x719F;&#x6089;&#x7684; <code>div</code>&#x3001;<code>span</code> &#x5143;&#x7D20;&#x800C;&#x8A00;&#xFF0C;&#x5728; Taro &#x4E2D;&#x6211;&#x4EEC;&#x8981;&#x5168;&#x90E8;&#x4F7F;&#x7528;&#x8FD9;&#x6837;&#x7684;&#x8DE8;&#x5E73;&#x53F0;&#x7EC4;&#x4EF6;&#x8FDB;&#x884C;&#x5F00;&#x53D1;&#x3002;</li>
</ol>
<p>&#x548C;&#x5165;&#x53E3;&#x7EC4;&#x4EF6;&#x4E00;&#x6837;&#xFF0C;&#x6BCF;&#x4E00;&#x4E2A;&#x9875;&#x9762;&#x7EC4;&#x4EF6;&#xFF08;&#x4F8B;&#x5982; <code>index.vue</code>&#xFF09;&#x4E5F;&#x4F1A;&#x6709;&#x4E00;&#x4E2A;&#x9875;&#x9762;&#x914D;&#x7F6E;&#xFF08;&#x4F8B;&#x5982; <code>index.config.js</code>&#xFF09;&#xFF0C;&#x6211;&#x4EEC;&#x53EF;&#x4EE5;&#x5728;&#x9875;&#x9762;&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x4E2D;&#x8BBE;&#x7F6E;&#x9875;&#x9762;&#x7684;&#x5BFC;&#x822A;&#x680F;&#x3001;&#x80CC;&#x666F;&#x989C;&#x8272;&#x7B49;&#x53C2;&#x6570;&#xFF0C;&#x4E00;&#x4E2A;&#x6700;&#x7B80;&#x5355;&#x7684;&#x9875;&#x9762;&#x914D;&#x7F6E;&#x5982;&#x4E0B;&#xFF1A;</p>
<p>src/pages/index/index.config.js</p>
<pre><code>export default {
  navigationBarTitleText: &apos;&#x9996;&#x9875;&apos;,
}
</code></pre><p>Taro &#x7684;&#x9875;&#x9762;&#x94A9;&#x5B50;&#x51FD;&#x6570;&#x548C;&#x9875;&#x9762;&#x914D;&#x7F6E;&#x89C4;&#x8303;&#x662F;&#x57FA;&#x4E8E;&#x5FAE;&#x4FE1;&#x5C0F;&#x7A0B;&#x5E8F;&#x800C;&#x5236;&#x5B9A;&#x7684;&#xFF0C;&#x5E76;&#x5BF9;&#x5168;&#x5E73;&#x53F0;&#x8FDB;&#x884C;&#x7EDF;&#x4E00;&#x3002; &#x4F60;&#x53EF;&#x4EE5;&#x901A;&#x8FC7;&#x8BBF;&#x95EE; <a href="https://docs.taro.zone/docs/react-page" target="_blank">React &#x9875;&#x9762;&#x7EC4;&#x4EF6;</a> &#x4E86;&#x89E3;&#x5168;&#x90E8;&#x9875;&#x9762;&#x94A9;&#x5B50;&#x51FD;&#x6570;&#x548C;&#x9875;&#x9762;&#x914D;&#x7F6E;&#x89C4;&#x8303;&#x3002;</p>
<h3 id="&#x81EA;&#x5B9A;&#x4E49;&#x7EC4;&#x4EF6;"><a name="&#x81EA;&#x5B9A;&#x4E49;&#x7EC4;&#x4EF6;" class="plugin-anchor" href="#&#x81EA;&#x5B9A;&#x4E49;&#x7EC4;&#x4EF6;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x81EA;&#x5B9A;&#x4E49;&#x7EC4;&#x4EF6;</h3>
<p>&#x5982;&#x679C;&#x4F60;&#x770B;&#x5230;&#x8FD9;&#x91CC;&#xFF0C;&#x90A3;&#x4E0D;&#x5F97;&#x4E0D;&#x606D;&#x559C;&#x4F60;&#xFF0C;&#x4F60;&#x5DF2;&#x7ECF;&#x7406;&#x89E3;&#x4E86; Taro &#x4E2D;&#x6700;&#x590D;&#x6742;&#x7684;&#x6982;&#x5FF5;&#xFF1A;&#x5165;&#x53E3;&#x7EC4;&#x4EF6;&#x548C;&#x9875;&#x9762;&#x7EC4;&#x4EF6;&#xFF0C;&#x5E76;&#x4E86;&#x89E3;&#x4E86;&#x5B83;&#x4EEC;&#x662F;&#x5982;&#x4F55;&#xFF08;&#x901A;&#x8FC7;&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#xFF09;&#x4EA4;&#x4E92;&#x7684;&#x3002;&#x63A5;&#x4E0B;&#x6765;&#x7684;&#x5185;&#x5BB9;&#xFF0C;</p>
<p>&#x6211;&#x4EEC;&#x5148;&#x628A;&#x9996;&#x9875;&#x5199;&#x597D;&#xFF0C;&#x9996;&#x9875;&#x7684;&#x903B;&#x8F91;&#x5F88;&#x7B80;&#x5355;&#xFF1A;&#x628A;&#x8BBA;&#x575B;&#x6700;&#x65B0;&#x7684;&#x5E16;&#x5B50;&#x5C55;&#x793A;&#x51FA;&#x6765;&#x3002;</p>
<p>src/pages/index/index.jsx</p>
<pre><code class="lang-react">import Taro from &apos;@tarojs/taro&apos;
import React from &apos;react&apos;
import { View } from &apos;@tarojs/components&apos;
import { ThreadList } from &apos;../../components/thread_list&apos;
import api from &apos;../../utils/api&apos;

import &apos;./index.css&apos;

class Index extends React.Component {
  config = {
    navigationBarTitleText: &apos;&#x9996;&#x9875;&apos;,
  }

  state = {
    loading: true,
    threads: [],
  }

  async componentDidMount() {
    try {
      const res = await Taro.request({
        url: api.getLatestTopic(),
      })
      this.setState({
        threads: res.data,
        loading: false,
      })
    } catch (error) {
      Taro.showToast({
        title: &apos;&#x8F7D;&#x5165;&#x8FDC;&#x7A0B;&#x6570;&#x636E;&#x9519;&#x8BEF;&apos;,
      })
    }
  }

  render() {
    const { loading, threads } = this.state
    return (
      &lt;View className=&quot;index&quot;&gt;
        &lt;ThreadList threads={threads} loading={loading} /&gt;
      &lt;/View&gt;
    )
  }
}

export default Index
</code></pre>
<p>&#x53EF;&#x80FD;&#x4F60;&#x4F1A;&#x6CE8;&#x610F;&#x5230;&#x5728;&#x4E00;&#x4E2A; Taro &#x5E94;&#x7528;&#x4E2D;&#x53D1;&#x9001;&#x8BF7;&#x6C42;&#x662F; <code>Taro.request()</code> &#x5B8C;&#x6210;&#x7684;&#x3002; &#x548C;&#x9875;&#x9762;&#x914D;&#x7F6E;&#x3001;&#x5168;&#x5C40;&#x914D;&#x7F6E;&#x4E00;&#x6837;&#xFF0C;Taro &#x7684; API &#x89C4;&#x8303;&#x4E5F;&#x662F;&#x57FA;&#x4E8E;&#x5FAE;&#x4FE1;&#x5C0F;&#x7A0B;&#x5E8F;&#x800C;&#x5236;&#x5B9A;&#x7684;&#xFF0C;&#x5E76;&#x5BF9;&#x5168;&#x5E73;&#x53F0;&#x8FDB;&#x884C;&#x7EDF;&#x4E00;&#x3002; &#x4F60;&#x53EF;&#x4EE5;&#x901A;&#x8FC7;&#x5728; <a href="https://docs.taro.zone/docs/apis/about/desc" target="_blank">API &#x6587;&#x6863;</a> &#x627E;&#x5230;&#x6240;&#x6709; API&#x3002;</p>
<p>&#x5728;&#x6211;&#x4EEC;&#x7684;&#x9996;&#x9875;&#x7EC4;&#x4EF6;&#x91CC;&#xFF0C;&#x8FD8;&#x5F15;&#x7528;&#x4E86;&#x4E00;&#x4E2A; <code>ThreadList</code> &#x7EC4;&#x4EF6;&#xFF0C;&#x6211;&#x4EEC;&#x73B0;&#x5728;&#x6765;&#x5B9E;&#x73B0;&#x5B83;&#xFF1A;</p>
<p>src/components/thread_list.jsx</p>
<pre><code class="lang-react">import React from &apos;react&apos;
import { View, Text } from &apos;@tarojs/components&apos;
import { Thread } from &apos;./thread&apos;
import { Loading } from &apos;./loading&apos;

import &apos;./thread.css&apos;

class ThreadList extends React.Component {
  static defaultProps = {
    threads: [],
    loading: true,
  }

  render() {
    const { loading, threads } = this.props

    if (loading) {
      return &lt;Loading /&gt;
    }

    const element = threads.map((thread, index) =&gt; {
      return (
        &lt;Thread
          key={thread.id}
          node={thread.node}
          title={thread.title}
          last_modified={thread.last_modified}
          replies={thread.replies}
          tid={thread.id}
          member={thread.member}
        /&gt;
      )
    })

    return &lt;View className=&quot;thread-list&quot;&gt;{element}&lt;/View&gt;
  }
}

export { ThreadList }
</code></pre>
<h2 id="&#x53C2;&#x8003;"><a name="&#x53C2;&#x8003;" class="plugin-anchor" href="#&#x53C2;&#x8003;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x53C2;&#x8003;</h2>
<p><a href="https://docs.taro.zone/docs/guide#%E5%A4%9A%E7%AB%AF%E5%BC%80%E5%8F%91" target="_blank">https://docs.taro.zone/docs/guide#%E5%A4%9A%E7%AB%AF%E5%BC%80%E5%8F%91</a> </p>
<footer class="page-footer"><span class="copyright">powered by Gitbook</span><span class="footer-modification">&#x8BE5;&#x6587;&#x4EF6;&#x4FEE;&#x8BA2;&#x65F6;&#x95F4;&#xFF1A;
2025-05-24 10:46:58
</span></footer>
<script>console.log("plugin-popup....");document.onclick = function(e){ e.target.tagName === "IMG" && window.open(e.target.src,e.target.src)}</script><style>img{cursor:pointer}</style>
                </div>
                <script src="https://my.openwrite.cn/js/readmore.js"></script>
                <script>
                    var enablePlugin = false;
                    var allowDomain = "localhost";
                    if(allowDomain){
                        var currentDomain = location.hostname;
                        if ($.isArray(allowDomain)) {
                            $.each(allowDomain, function(index, item) {
                                if (currentDomain == item) {
                                    enablePlugin = true;
                                    return false;
                                }
                            });
                        }else{
                           if (currentDomain == allowDomain) {
                                enablePlugin = true;
                            }
                        }
                    }else{
                        enablePlugin = true;
                    }
                    
                    if(enablePlugin){
                        var isMobile = navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i);
                        if (!isMobile) {
                            var btw = new BTWPlugin();
                            btw.init({"allowDomain":"localhost","blogId":"27976-1678928361372-483","name":"坚果派","qrcode":"https://luckly007.oss-cn-beijing.aliyuncs.com/images/image-20230316085818226.png","keyword":"鸿蒙坚果","id":"vip-container"});
                        }
                    }
                </script> 
          </section>
          
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>
 
          <div class="book-footer">
            
            <div class="donate">
              <div></div>
              <button class="donate-btn" onclick="showModal()">赞赏</button>
            </div>
             
            <div class="copyright"></div>
            
          </div>
          
        </div>
      </div>
      
    </div>

     
    <a
      href="../为什么要写博客.html"
      class="
        navigation navigation-prev
        
      "
      aria-label="Previous page: 为什么选择 Taro For Harmony？"
    >
      <i class="fa fa-angle-left"></i>
    </a>
     
    <a
      href="2.安装Taro.html"
      class="
        navigation navigation-next
        
      "
      aria-label="Next page: 3.2 安装与配置 Taro"
    >
      <i class="fa fa-angle-right"></i>
    </a>
      
  </div>
  <script>
    function showModal() {
      document.getElementsByClassName("mask")[0].style.display = "block";
      document.getElementsByClassName("donate-modal")[0].style.display =
        "block";
    }
    // 切换赞赏码
    function showDonateImg(num) {
      let alipay = "";
      let wxpay = ""
      if(num){
        wxpay = "hidden"
      }else{
        alipay = "hidden"
      }
      document.getElementById("wxpay-code").hidden = wxpay;
      document.getElementById("alipay-code").hidden = alipay;
      document.getElementsByName("pay-way")[num].checked = "checked";
    }

    // 关闭赞赏框
    function closeDonateModal() {
      document.getElementsByClassName("mask")[0].style.display = "none";
      document.getElementsByClassName("donate-modal")[0].style.display = "none";
    }

    var gitbook = gitbook || [];
    gitbook.push(function () {
      gitbook.page.hasChanged({"page":{"title":"3.1 Taro 框架介绍","level":"2.1","depth":1,"next":{"title":"3.2 安装与配置 Taro","level":"2.2","depth":1,"path":"chapter1/2.安装Taro.md","ref":"./chapter1/2.安装Taro.md","articles":[]},"previous":{"title":"为什么选择 Taro For Harmony？","level":"1.2","depth":1,"path":"为什么要写博客.md","ref":"为什么要写博客.md","articles":[]},"dir":"ltr"},"config":{"plugins":["github-buttons@2.1.0","edit-link","splitter","tbfed-pagefooter","expandable-chapters","chapter-fold","back-to-top-button","code","pageview-count","popup","search-plus","-lunr","-search","splitter","-sharing","sharing-plus","theme-lou","mind-maps","emphasize","anchors","changyan","readmore","livereload","ace","livereload"],"root":".","styles":{"website":"styles/website.css"},"pluginsConfig":{"tbfed-pagefooter":{"modify_label":"该文件修订时间：","modify_format":"YYYY-MM-DD HH:mm:ss"},"chapter-fold":{},"pluginsConfig":{"expandable-chapters":{}},"emphasize":{},"ace":{},"livereload":{},"splitter":{},"readmore":{"allowDomain":"localhost","blogId":"27976-1678928361372-483","name":"坚果派","qrcode":"https://luckly007.oss-cn-beijing.aliyuncs.com/images/image-20230316085818226.png","keyword":"鸿蒙坚果"},"sharing-plus":{"qq":false,"all":["facebook","google","twitter","instapaper","linkedin","pocket","stumbleupon"],"douban":false,"facebook":true,"weibo":false,"instapaper":false,"whatsapp":false,"hatenaBookmark":false,"twitter":true,"messenger":false,"line":false,"vk":false,"pocket":true,"google":false,"viber":false,"stumbleupon":false,"qzone":false,"linkedin":false},"popup":{},"code":{"copyButtons":true},"theme-lou":{"hide-elements":[".summary .gitbook-link",".summary .divider"],"color":"#FF4848","book-anchor-title":"本章目录","copyright":{"author":"vx:nut_pie"},"forbidCopy":true,"logo":"assets/avatar.png","book-summary-title":"文章目录","search-placeholder":"输入关键字搜索","copyrightLogo":"assets/copyright.png","favicon":"assets/avatar.png","appleTouchIconPrecomposed152":"assets/avatar.png"},"changyan":{"appid":"cyvHoCPAs","conf":"0440cfc4168ba95d73cfc52dd4d5c60b"},"fontsettings":{"theme":"white","family":"sans","size":2},"mind-maps":{},"highlight":{},"back-to-top-button":{},"pageview-count":{},"github-buttons":{"repo":"ITmxs/gitbook","types":["star","watch","fork"],"size":"small"},"sharing":{"qq":false,"all":["qq","qzone","whatsapp","douban","facebook","google","instapaper","linkedin","messenger","twitter","weibo"],"douban":false,"facebook":false,"weibo":false,"twitter":false,"pocket":false,"google":false,"qzone":false},"edit-link":{"label":"编辑此页","base":"https://github.com/ITmxs/gitbook/edit/master/"},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"anchors":{},"expandable-chapters":{},"search-plus":{}},"theme":"default","author":"坚果派","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{"themeLou":{"nav":[{"target":"_blank","url":"https://www.gitbook.com/","name":"坚果派官网"},{"target":"_blank","url":"https://www.npmjs.com/package/package","name":"ArkUI实战"},{"target":"_blank","url":"https://space.bilibili.com/480883651","name":"元服务开发实践"},{"target":"_blank","url":"https://blog.51cto.com/jianguo","name":"OpenHarmony应用开发"}],"footer":{"donate":{"wechat":"https://luckly007.oss-cn-beijing.aliyuncs.com/img/image-20210922202901895.png","message":"随意打赏，但不要超过一顿早餐钱 💕","wxpay":"https://luckly007.oss-cn-beijing.aliyuncs.com/img/image-20210922202901895.png","alipay":"https://luckly007.oss-cn-beijing.aliyuncs.com/img/image-20210922202843746.png","nickname":"breeze","button":"打赏","wechatText":"微信","alipayText":"支付宝","title":"『赠人玫瑰 🌹 手有余香 』","avatar":"http://xkapp-uat.oss-cn-hangzhou.aliyuncs.com/2e7a3f70-80ab-4b50-93ec-a04dfeef949b/avatar-100.png"},"copyright":true}}},"title":"Taro for Harmony教程","language":"zh-hans","gitbook":"*","description":"Taro for Harmony电子书教程"},"file":{"path":"chapter1/1.Taro介绍.md","mtime":"2025-05-24T02:46:58.360Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2025-06-30T01:16:51.558Z"},"basePath":"..","book":{"language":""}});
    });
  </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-github-buttons/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-edit-link/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-splitter/splitter.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-expandable-chapters/expandable-chapters.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-chapter-fold/chapter-fold.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-back-to-top-button/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-code/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-pageview-count/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search-plus/jquery.mark.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search-plus/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing-plus/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-mind-maps/mindmaps.dist.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-changyan/changyan.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-livereload/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-ace/ace/ace.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-ace/ace.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-theme-lou/lou.js"></script>
        
    

    </body>
</html>

